package com.wh.weibo.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wh.weibo.util.DateJsonSerializer;

import java.io.Serializable;
import java.util.Date;

/**
 * @author WeiHong
 * @date 2019/7/9 10:15
 */
public class Weibo implements Serializable {
    private Integer id;

    private String content;

    private String imgUrl;

    private Integer likeCount;

    private Integer remarkCount;

    /**
     * JSON 转出后，格式化时间
     */
    @JsonSerialize(using = DateJsonSerializer.class)
    private Date createTime;

    private Integer userId;

    private Integer topicId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl == null ? null : imgUrl.trim();
    }

    public Integer getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }

    public Integer getRemarkCount() {
        return remarkCount;
    }

    public void setRemarkCount(Integer remarkCount) {
        this.remarkCount = remarkCount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }


    public Integer getTopicId() {
        return topicId;
    }

    public void setTopicId(Integer topicId) {
        this.topicId = topicId;
    }

    @Override
    public String toString() {
        return "Weibo{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", imgUrl='" + imgUrl + '\'' +
                ", likeCount=" + likeCount +
                ", remarkCount=" + remarkCount +
                ", createTime=" + createTime +
                ", userId=" + userId +
                ", topicId=" + topicId +
                '}';
    }
}